<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  <title></title>
  <!-- css -->
  <link rel="stylesheet" href="css/reset.css" />
  <link rel="stylesheet" href="css/mui.css" />
  <link rel="stylesheet" href="css/index.css" />
  <link rel="stylesheet" href="css/login.css" />
  <link rel="stylesheet" href="css/icon-extra.css" />
  <link rel="stylesheet" href="css/icon-daguanjia.css" />
  <!-- css-end -->
  <!-- js -->
  <script src="js/mui.js"></script>
  <script src="js/common.js"></script>
  <script type="text/javascript" src="http://api.map.baidu.com/api?v=1.3&ak=密钥"></script>
  <script type="text/javascript" src="http://developer.baidu.com/map/jsdemo/demo/convertor.js"></script>
  <script type="text/javascript" src="js/get.localcity.js"></script>
  <!-- js-end -->
</head>
<!--L31-移动WEB：100.5vw-->
<!--L31-APP：84.5vw-->
<style type="text/css">
  .jf-vertical {
    vertical-align: middle;
  }
  
  .mui-control-content9 {
    height: 100.5vw !important;
  }
  
  .ind-width {
    width: 100vw !important;
  }
  
  .ind-spb-width {
    width: 50vw;
  }
  
  .ind-logout {
    padding: 0 15px;
  }
  
  .ind-grid {
    margin-bottom: 15px;
  }
  
  .mui-grid-view.mui-grid-9 {
    background-color: #fff;
  }
  
  .ind-a-box {
    display: flex !important;
    justify-content: center;
    align-items: center;
    padding: 0 !important;
  }
  
  .ind-icon-size {
    font-size: 1em !important;
  }
  
  .ind-media-title {
    width: auto !important;
    margin-top: 0 !important;
    margin-left: 5px;
  }
  
  .ind-cybz-container p {
    margin-top: 10px;
  }
  
  .ind-grey {
    display: inline-block;
    text-align: center;
    vertical-align: middle;
    width: 3em;
    height: 1.8em;
    margin-right: 10px;
    line-height: 1.8em;
    border-radius: 2px;
    background-color: #797b8a;
    color: #fff;
  }
</style>

<body>
  <header class="mui-bar mui-bar-nav">
    <h1 class="mui-title">大管家</h1>
  </header>
  <div class="mui-content" id="pullrefresh">
    <div class="ind-grid">
      <ul class="mui-table-view mui-grid-view mui-grid-9 ind-ul-color" style="height: 80px">
        <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4">
          <a href="pages/person_center.html" class="ind-a-box">
            <span class="mui-icon mui-icon-contact ind-icon-size"></span>
            <div class="mui-media-body ind-media-title">我的</div>
          </a>
        </li>
        <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4">
          <a href="./pages/citys.html" class="ind-a-box">
            <span class="mui-icon-extra icon-dgj-chengshifuwu ind-icon-size"></span>
            <div class="mui-media-body ind-media-title">城市</div>
          </a>
        </li>
        <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4">
          <a class="ind-a-box" id="logout">
            <span class="mui-icon-extra icon-dgj-tuichu1 ind-icon-size"></span>
            <div class="mui-media-body ind-media-title">退出</div>
          </a>
        </li>
        <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4">
          <a href="./pages/notice_list.html" class="ind-a-box">
            <span class="mui-icon mui-icon-email ind-icon-size"></span>
            <div class="mui-media-body ind-media-title">消息</div>
          </a>
        </li>
        <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4">
          <a href="javascript:;" class="ind-a-box developing">
            <span class="mui-icon-extra icon-dgj-guanliyuan_guanliyuanrizhi ind-icon-size"></span>
            <div class="mui-media-body ind-media-title">管理</div>
          </a>
        </li>
        <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4">
          <a href="./pages/setting.html" class="ind-a-box">
            <span class="mui-icon mui-icon-gear ind-icon-size"></span>
            <div class="mui-media-body ind-media-title">设置</div>
          </a>
        </li>
      </ul>
    </div>

    <div id="slider" class="mui-slider">
      <div class="mui-slider-group mui-slider-loop">
        <!-- 额外增加的一个节点(循环轮播：第一个节点是最后一张轮播) -->
        <div class="mui-slider-item mui-slider-item-duplicate">
          <a href="#">
            <img src="images/cbd.jpg" style="height: 55vw;">
          </a>
        </div>
        <!-- 第一张 -->
        <div class="mui-slider-item">
          <a href="#">
            <img src="images/xuanchuan.jpg" style="height: 55vw;">
          </a>
        </div>
        <!-- 第二张 -->
        <div class="mui-slider-item">
          <a href="#">
            <img src="images/shuijiao.jpg" style="height: 55vw;">
          </a>
        </div>
        <!-- 第三张 -->
        <div class="mui-slider-item">
          <a href="#">
            <img src="images/yuantiao.jpg" style="height: 55vw;">
          </a>
        </div>
        <!-- 第四张 -->
        <div class="mui-slider-item">
          <a href="#">
            <img src="images/cbd.jpg" style="height: 55vw;">
          </a>
        </div>
        <!-- 额外增加的一个节点(循环轮播：最后一个节点是第一张轮播) -->
        <div class="mui-slider-item mui-slider-item-duplicate">
          <a href="#">
            <img src="images/xuanchuan.jpg" style="height: 55vw;">
          </a>
        </div>
      </div>
      <div class="mui-slider-indicator">
        <div class="mui-indicator mui-active"></div>
        <div class="mui-indicator"></div>
        <div class="mui-indicator"></div>
        <div class="mui-indicator"></div>
      </div>
    </div>

    <div id="tabBar" class="mui-slider">
      <div id="sliderSegmentedControl" class="mui-slider-indicator mui-segmented-control mui-segmented-control-inverted ind-width">
        <a class="mui-control-item" href="#item1mobile">需求帮助者</a>
        <a class="mui-control-item" href="#item2mobile">提供帮助者</a>
      </div>

      <div id="sliderProgressBar" class="mui-slider-progress-bar ind-spb-width"></div>

      <div class="mui-slider-group" id="tabBarContainer" style="height: 104vw;">
        <div id="item1mobile" class="mui-slider-item mui-control-content mui-active" style="border: none;">
          <div id="scroll1" class="mui-scroll-wrapper">
            <div class="mui-scroll">
              <!--老板发送任务-->
              <div class="jf-task">
                <div class="jsg-up">
                  <div class="jsgu-left">
                    <h4>大管家</h4>
                    <p>大管家生活帮，帮助你生活的点点滴滴</p>
                  </div>
                  <div class="jsgu-right">
                    <img src="images/richu.png" alt="日出" />
                  </div>
                </div>
                <div class="jsg-down">
                  <button type="button" class="mui-btn" style="margin-right: 10px;" onclick="releaseTechHelp('tech')">发布需求技术帮助</button>
                  <button type="button" class="mui-btn" style="margin-left: 10px;" onclick="releaseNormHelp('norm')">发布需求普通帮助</button>
                </div>
              </div>

              <div class="jf-task-box" style="padding-bottom: 0;">
                <div class="jf-task-content">
                  <div class="mui-table-view-cell">
                    <a href="javascript:;" class="mui-navigate-right myNeedHelp">
                      <span class="mui-icon-extra icon-dgj-daichuli jf-topic"></span>待完成需求帮助</a>
                  </div>
                </div>
              </div>

              <!--老板发任务日-->
              <div class="jf-task-box">
                <p class="jf-task-title">发现</p>
                <div class="jf-task-content">
                  <div class="mui-table-view-cell">
                    <a href="javascript:;" class="mui-navigate-right offerHelp1">
                      <span class="mui-icon-extra icon-dgj-jishu jf-topic"></span>附近提供技术帮助</a>
                  </div>
                  <div class="mui-table-view-cell">
                    <a href="javascript:;" class="mui-navigate-right offerHelp1">
                      <span class=" mui-icon-extra mui-icon-extra-topic jf-topic "></span>附近提供普通帮助</a>
                  </div>
                  <div class="mui-table-view-cell">
                    <a href="javascript:;" class="mui-navigate-right offerHelp1">
                      <span class=" mui-icon-extra icon-dgj-wode jf-topic "></span>我要的提供帮助</a>
                  </div>
                </div>
              </div>

              <!--发现-->
              <!-- <div class="jf-task-box" style="padding-top: 0;">
                <p class="jf-task-title">发现</p>
                <div class="jf-task-content">
                  <div class="mui-table-view-cell">
                    <a href="#putong" class="mui-navigate-right mnr-flex">
                      <div class="mnr-content-left">
                        <span class="mui-icon-extra icon-dgj-yibanrenwu jf-topic"></span>普通任务
                      </div>
                      <div class="mnr-content-right">
                        <p class="jf-float-left">135人</p>
                      </div>
                    </a>
                    <ul class="mtvc-ul">
                      <li class="mtvc-lis">
                        <p class="mtvc-ps">望京</p><span class="mtvc-grey">13人</span>
                      </li>
                      <li class="mtvc-lis">
                        <p class="mtvc-ps">酒仙桥</p><span class="mtvc-grey">11人</span>
                      </li>
                      <li class="mtvc-lis">
                        <p class="mtvc-ps">朝外</p><span class="mtvc-grey">9人</span>
                      </li>
                      <li class="mtvc-lis">
                        <p class="mtvc-ps">朝阳路</p><span class="mtvc-grey">16人</span>
                      </li>
                      <li class="mtvc-lis">
                        <p class="mtvc-ps">亚运村</p><span class="mtvc-grey">9人</span>
                      </li>
                      <li class="mtvc-lis">
                        <p class="mtvc-ps">建国路</p><span class="mtvc-grey">4人</span>
                      </li>
                      <li class="mtvc-lis">
                        <p class="mtvc-ps">北苑</p><span class="mtvc-grey">6人</span>
                      </li>
                      <li class="mtvc-lis">
                        <p class="mtvc-ps">来广营</p><span class="mtvc-grey">5人</span>
                      </li>
                    </ul>
                  </div>
                  <div class="mui-table-view-cell">
                    <a href="#zhuanye" class="mui-navigate-right mnr-flex">
                      <div class="mnr-content-left">
                        <span class="mui-icon-extra icon-dgj-zhuanyezhishijineng jf-topic"></span>专业任务
                      </div>
                      <div class="mnr-content-right">
                        <p class="jf-float-left">155人</p>
                      </div>
                    </a>
                    <ul class="mtvc-ul">
                      <li class="mtvc-lis">
                        <p class="mtvc-ps">天津</p><span class="mtvc-grey">13人</span>
                      </li>
                      <li class="mtvc-lis">
                        <p class="mtvc-ps">廊坊</p><span class="mtvc-grey">11人</span>
                      </li>
                      <li class="mtvc-lis">
                        <p class="mtvc-ps">保定</p><span class="mtvc-grey">9人</span>
                      </li>
                      <li class="mtvc-lis">
                        <p class="mtvc-ps">张家口</p><span class="mtvc-grey">16人</span>
                      </li>
                      <li class="mtvc-lis">
                        <p class="mtvc-ps">承德</p><span class="mtvc-grey">9人</span>
                      </li>
                      <li class="mtvc-lis">
                        <p class="mtvc-ps">邯郸</p><span class="mtvc-grey">4人</span>
                      </li>
                      <li class="mtvc-lis">
                        <p class="mtvc-ps">石家庄</p><span class="mtvc-grey">6人</span>
                      </li>
                      <li class="mtvc-lis">
                        <p class="mtvc-ps">唐山</p><span class="mtvc-grey">5人</span>
                      </li>
                    </ul>
                  </div>
                </div>
              </div> -->
            </div>
          </div>
        </div>

        <div id="item2mobile" class="mui-slider-item mui-control-content" style="border: none;">
          <div id="scroll2" class="mui-scroll-wrapper">
            <div class="mui-scroll">
              <div class="mui-loading" style="margin-top: 20vw;">
                <div class="mui-spinner">
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <div class="jf-task-box" style="padding-top: 0;">
      <p class="jf-task-title">大管家服务</p>
      <div class="jf-task-content">
        <!-- <div class="mui-table-view-cell">
          <a href="#putong" class="mui-navigate-right mnr-flex">
            <div class="mnr-content-left">
              <span class="mui-icon-extra icon-dgj-fujin jf-topic"></span>附近需要帮助者
            </div>
            <div class="mnr-content-right">
              <p class="jf-float-left">9人</p>
            </div>
          </a>
          <ul class="mtvc-ul">
            <li class="mtvc-lis">
              <p class="mtvc-ps">需要理发</p><span class="mtvc-grey">2人</span>
            </li>
            <li class="mtvc-lis">
              <p class="mtvc-ps">需要理疗</p><span class="mtvc-grey">1人</span>
            </li>
            <li class="mtvc-lis">
              <p class="mtvc-ps">需要学习</p><span class="mtvc-grey">3人</span>
            </li>
            <li class="mtvc-lis">
              <p class="mtvc-ps">需要厨师</p><span class="mtvc-grey">3人</span>
            </li>
          </ul>
        </div>
        <div class="mui-table-view-cell">
          <a href="#putong" class="mui-navigate-right mnr-flex">
            <div class="mnr-content-left">
              <span class="mui-icon-extra icon-dgj-chengshifuwu jf-topic"></span>市内需要服务者
            </div>
            <div class="mnr-content-right">
              <p class="jf-float-left">10人</p>
            </div>
          </a>
          <ul class="mtvc-ul">
            <li class="mtvc-lis">
              <p class="mtvc-ps">需要理发美容室</p><span class="mtvc-grey">5人</span>
            </li>
            <li class="mtvc-lis">
              <p class="mtvc-ps">需要理疗保健</p><span class="mtvc-grey">2人</span>
            </li>
            <li class="mtvc-lis">
              <p class="mtvc-ps">需要编辑出版社</p><span class="mtvc-grey">3人</span>
            </li>
          </ul>
        </div> -->

        <div class="mui-table-view-cell">
          <a href="pages/points_mall.html" class="mui-navigate-right mnr-flex">
            <div class="mnr-content-left">
              <span class="mui-icon-extra icon-dgj-jifen jf-topic"></span>积分商城
            </div>
          </a>
        </div>
        <div class="mui-table-view-cell">
          <a href="#baoxian" class="mui-navigate-right mnr-flex developing">
            <div class="mnr-content-left">
              <span class="mui-icon-extra icon-dgj-baoxianfuwu jf-topic"></span>保险
            </div>
          </a>
        </div>
        <div class="mui-table-view-cell">
          <a href="pages/wallet_pay.html" class="mui-navigate-right mnr-flex">
            <div class="mnr-content-left">
              <span class="mui-icon-extra icon-dgj-qianbao jf-topic"></span>钱包·支付
            </div>
          </a>
        </div>
        <div class="mui-table-view-cell">
          <a href="pages/vr_games.html" class="mui-navigate-right mnr-flex">
            <div class="mnr-content-left">
              <span class="mui-icon-extra icon-dgj-iconset0263 jf-topic"></span>VR游戏
            </div>
          </a>
        </div>
        <div class="mui-table-view-cell">
          <a href="#huiyuan" class="mui-navigate-right mnr-flex developing">
            <div class="mnr-content-left">
              <span class="mui-icon-extra icon-dgj-huiyuan jf-topic"></span>会员招募
            </div>
          </a>
        </div>
      </div>
    </div>

    <!--<div class="ind-logout">
      <button type="button" class="mui-btn mui-btn-block mui-btn-danger">退出登录</button>
    </div>-->

    <div id="map" style="display: none;"></div>

  </div>

</body>
<script src="js/app.js"></script>

<script type="text/javascript">
  var logoutEle = document.getElementById('logout'),
    myNeedHelpEle = document.querySelector('.myNeedHelp'),
    // backButtonPress = 0,
    $ = mui;

  logoutEle.addEventListener('tap', toLogout);

  window.onload = function() {
    init(mui);

    switchTab();

    localcity.getLocation(getCityCB);

    developingEve();

    toOfferHelp1();

    refresh();

    myNeedHelpEle.addEventListener('tap', app.toPage.bind(myNeedHelpEle, 'pages/my_need_helps.html?title=' + myNeedHelpEle.innerText));
  }

  function toNeedHelp2() {
    $('.needHelp2').each(function(idx, el) {
      var pageArr = ['./pages/need_tech_helps.html?title=附近需求技术帮助', './pages/need_norm_helps.html?title=附近需求普通帮助', './pages/my_need_order.html?title=我要的需求帮助']
      el.addEventListener('tap', app.toPage.bind(this, pageArr[idx]));
    });
  }

  function toOfferHelp1() {
    $('.offerHelp1').each(function(idx, el) {
      var pageArr = ['./pages/offer_tech_helps.html?title=附近提供技术帮助', './pages/offer_norm_helps.html?title=附近提供普通帮助', './pages/my_offer_order.html?title=我要的提供帮助']
      el.addEventListener('tap', app.toPage.bind(this, pageArr[idx]));
    });
  }

  function init($) {
    /*if(window.plus) {
    	plusReady();
    } else {
    	document.addEventListener('plusready', plusReady, false);
    }*/

    $('#slider').slider({
      interval: 3000
    });

    toggleTabBar($);
  }

  function developingEve() {
    let developingEles = Array.from(document.querySelectorAll('.developing'));

    developingEles.map((value, index) => {
      value.addEventListener('tap', (e) => {
        e.preventDefault();
        mui.toast('近期开发,敬请期待...');
      });
    });
  }

  //		function plusReady() {}
  // Android处理返回键
  /*plus.key.addEventListener('backbutton', function() {
  	('iOS' == plus.os.name) ? plus.nativeUI.confirm('确认退出？', function(e) {
  		if(e.index > 0) {
  			plus.runtime.quit();
  		}
  	}, 'HelloH5', ['取消', '确定']): (confirm('确认退出？') && plus.runtime.quit());
  }, false);*/

  // Android处理返回键
  //			plus.key.addEventListener('backbutton', function(event) {
  //				return;
  //				event.preventDefault();

  /*backButtonPress++;
  if(backButtonPress > 1) {
  	plus.runtime.quit();
  } else {
  	plus.nativeUI.toast('再按一次退出应用');
  }
  setTimeout(function() {
  	backButtonPress = 0;
  }, 1000);
  return false;*/
  //			}, false)



  function toLogout(e) {
    e.preventDefault();
    localStorage.removeItem('$state');
    localStorage.getItem('$state') === null ? location.href = 'index.html' : mui.toast('退出失败!');
  }

  function needHelp() {
    $.openWindow({
      url: 'pages/add_task.html',
      id: 'add_task',
      show: {
        aniShow: 'pop-in'
      },
      waiting: {
        autoShow: false
      }
    })
  }

  function releaseTechHelp(helpType) {
    $.openWindow({
      url: 'pages/add_tech_task.html?helpType=' + helpType,
      id: 'add_tech_task',
      show: {
        aniShow: 'pop-in'
      },
      waiting: {
        autoShow: false
      }
    });
  }

  function releaseNormHelp(helpType) {
    $.openWindow({
      url: 'pages/add_norm_task.html?helpType=' + helpType,
      id: 'add_norm_task',
      show: {
        aniShow: 'pop-in'
      },
      waiting: {
        autoShow: false
      }
    });
  }

  function toggleTabBar($) {
    $('.mui-scroll-wrapper').scroll({
      indicators: true //是否显示滚动条
    });

    // <button type="button" class="mui-btn">查看附近任务</button>
    // var html2 = '<!--工人接收任务--> <div class="jf-task"> <div class="jsg-up"> <div class="jsgu-left"> <h4>大管家</h4> <p>大管家生活帮，帮助你生活的点点滴滴</p> </div> <div class="jsgu-right"> <img src="images/richu.png" alt="日出" /> </div> </div> <div class="jsg-down"> <button type="button" class="mui-btn" onclick="offerHelp()">提供帮助</button> </div> </div><div class="jf-task-box"> <p class="jf-task-title">常用帮助</p> <div class="jf-task-content"> <div class="mui-table-view-cell"> <a href="#jiangli" class="mui-navigate-right"> <div class="ind-cybz-container"><div class="ind-cybz-title"><span class="ind-grey">常用</span>18:20</div> <p>我是一名优秀的电器设备修理师</p> </div> </a> </div> </div> </div>';
    var html2 = '<div class="jf-task"><div class="jsg-up"><div class="jsgu-left"><h4>大管家</h4><p>大管家生活帮，帮助你生活的点点滴滴</p></div><div class="jsgu-right"><img src="images/richu.png" alt="日出"></div></div><div class="jsg-down"><button type="button" class="mui-btn sendTask" style="margin-right:10px" onclick="offerTechHelp()">发布提供技术帮助</button> <button type="button" class="mui-btn sendTask" style="margin-left:10px" onclick="offerNormHelp()">发布提供普通帮助</button></div></div><div class="jf-task-box"style="padding-bottom: 0;"><div class="jf-task-content"><div class="mui-table-view-cell"><a href="javascript:;"class="mui-navigate-right myOfferHelp"><span class="mui-icon-extra icon-dgj-daichuli jf-topic"></span>待完成提供帮助</a></div></div></div><div class="jf-task-box"><p class="jf-task-title">发现</p><div class="jf-task-content"><div class="mui-table-view-cell"><a href="javascript:;" class="mui-navigate-right needHelp2"><span class="mui-icon-extra icon-dgj-jishu jf-topic"></span>附近需求技术帮助</a></div><div class="mui-table-view-cell"><a href="javascript:;" class="mui-navigate-right needHelp2"><span class="mui-icon-extra mui-icon-extra-topic jf-topic"></span>附近需求普通帮助</a></div><div class="mui-table-view-cell"><a href="javascript:;" class="mui-navigate-right needHelp2"><span class="mui-icon-extra icon-dgj-wode jf-topic"></span>我要的需求帮助</a></div></div></div>';
    var item2 = document.getElementById('item2mobile');
    var tabBarContainer = document.getElementById('tabBarContainer');
    document.getElementById('tabBar').addEventListener('slide', function(e) {
      if (e.detail.slideNumber === 0) {
        // item2.style.height = '67vw';
        tabBarContainer.style.height = '104vw';
      }

      if (e.detail.slideNumber === 1) {
        tabBarContainer.style.height = '104vw';
        if (item2.querySelector('.mui-loading')) {
          // tabBarContainer.style.height = '43vw';
          setTimeout(function() {
            item2.querySelector('.mui-scroll').innerHTML = html2;

            /* $('.ind-login-extra').each(function(idx, el) {
              var pageArr = ['./pages/task_hall.html', './pages/order_list.html']
              el.addEventListener('tap', toPage.bind(this, $, pageArr[idx]));
            }); */

            toNeedHelp2();

            document.querySelector('.myOfferHelp').addEventListener('tap', app.toPage.bind(this, 'pages/my_offer_helps.html?title=待完成提供帮助'));
          }, 500);
        }
      }
    });
  }

  function offerTechHelp() {
    $.openWindow({
      url: 'pages/add_tech_offer.html?helpType=tech',
      id: 'add_tech_offer',
      show: {
        aniShow: 'pop-in'
      },
      waiting: {
        autoShow: false
      }
    });
  }

  function offerNormHelp() {
    $.openWindow({
      url: 'pages/add_norm_offer.html?helpType=norm',
      id: 'add_norm_offer',
      show: {
        aniShow: 'pop-in'
      },
      waiting: {
        autoShow: false
      }
    });
  }

  function toPage($, page) {
    $.openWindow({
      url: page,
      id: page.split('.')[1],
      show: {
        aniShow: 'pop-in'
      },
      waiting: {
        autoShow: false
      }
    });
  }

  function getCityCB(baiduAddress) {
    /*var address = "百度标注：" + baiduAddress.province + "," + baiduAddress.city + "," + baiduAddress.district + "," + baiduAddress.street + "," + baiduAddress.streetNumber;
    alert(address);*/
    /* let cityEle = document.getElementById('city'),
      curAddress = JSON.stringify(baiduAddress);
    city = baiduAddress.city

    localStorage.setItem('curAddress', curAddress);
    cityEle.innerText = city; */

    localStorage.setItem('$baiduAddress', JSON.stringify(baiduAddress));
    // console.log(baiduAddress);
  }

  function showCitys() {
    location.href = "pages/citys.html"
  }

  function toPersonCenter() {
    //  location.href = "pages/person_center.html"
    location.href = "pages/login.html"
  }

  function switchTab() {
    let aTags = document.querySelectorAll('.jf-list a'),
      jfMembers = document.querySelectorAll('.jf-slider-group>div');

    aTags = Array.from(aTags);
    jfMembers = Array.from(jfMembers);

    aTags.map(function(value, index) {
      value.onclick = function() {
        jfMembers.map((val, ind) => {
          aTags[ind].className = 'jf-item';
          jfMembers[ind].style.display = 'none';
        });
        aTags[index].className = 'jf-item jf-item-active';
        jfMembers[index].style.display = 'block';
      }
    });
  }

  function refresh() {
    /* mui.init({
      pullRefresh: {
        container: "#refreshContainer", //下拉刷新容器标识，querySelector能定位的css选择器均可，比如：id、.class等
        down: {
          style: 'circle', //必选，下拉刷新样式，目前支持原生5+ ‘circle’ 样式
          // color: '#2BD009', //可选，默认“#2BD009” 下拉刷新控件颜色
          // height: '50px', //可选,默认50px.下拉刷新控件的高度,
          // range: '100px', //可选 默认100px,控件可下拉拖拽的范围
          // offset: '0px', //可选 默认0px,下拉刷新控件的起始位置
          // auto: true, //可选,默认false.首次加载自动上拉刷新一次
          callback: function () {
            console.log(123123);
            // location.reload();
          } //必选，刷新函数，根据具体业务来编写，比如通过ajax从服务器获取新数据；
        }
      }
    }); */

    /* mui.init({
      pullRefresh: {
        container: '#refreshContainer',
        down: {
          style: 'circle',
          callback: function () { console.log(111); }
        },
        up: {
          // auto: true,
          contentrefresh: '正在加载...',
          callback: function () { console.log(000) }
        }
      }
    }); */

    mui.init({
      pullRefresh: {
        container: '#pullrefresh',
        down: {
          style: 'circle',
          callback: pulldownRefresh
        }
        /* ,
                up: {
                  // auto: true,
                  contentrefresh: '正在加载...',
                  callback: pullupRefresh
                } */
      }
    });

  }

  /* var count = 0;

    function pullupRefresh() {
      setTimeout(function() {
        mui('#pullrefresh').pullRefresh().endPullupToRefresh((++count > 2)); //参数为true代表没有更多数据了。
        console.log(744);
      }, 1500);
    } */

  /**
   * 下拉刷新具体业务实现
   */
  function pulldownRefresh() {
    setTimeout(function() {
      mui('#pullrefresh').pullRefresh().endPulldownToRefresh();
      console.log(754);
      location.reload();

      mui.toast("刷新成功...");
    }, 1500);
  }

  //		mui.plusReady(function() {
  $.plusReady(function() {
    var backButtonPress = 0;
    $.back = function(event) {
      backButtonPress++;
      if (backButtonPress > 1) {
        plus.runtime.quit();
      } else {
        plus.nativeUI.toast('再按一次退出应用');
      }
      setTimeout(function() {
        backButtonPress = 0;
      }, 1000);
      return false;
    };
  });
</script>

</html>